package darknet.application.chat.spec;

import darknet.core.spec.net.Node;
import java.io.IOException;

/**
 * A chat session between two nodes (only).
 * Messages shared are private (PM).
 *
 * @author yoyo
 */
public interface Session extends ObservableSession {

    /**
     * Start the session.
     * 
     * @throws IOException
     */
    void start() throws IOException;

    /**
     * Send a message to the session.
     *
     * @param message
     * @throws IOException
     */
    void speak(String message) throws IOException;

    /**
     * Exit from this session.
     *
     * @throws IOException
     */
    void exit() throws IOException;

    /**
     * Get the node we are chatting with.
     * @return
     */
    Node getNode();
}
